import request from '@/utils/request'

export function getDish(params) {
  return request({
    url: '/dish/page',
    method: 'get',
    params
  })
}

export function deleteDish(ids) {
  return request({
    url: '/dish',
    method: 'delete',
    params: { ids }
  })
}

export function dishStatus(params) {
  return request({
    url: `/dish/status/${params.status}`,
    method: 'post',
    params: { ids: params.id }
  })
}

export function getCategoryList(params) {
  return request({
    url: '/category/list',
    method: 'get',
    params
  })
}

export function commonDownload(params) {
  return request({
    url: '/common/download',
    method: 'get',
    params
  })
}

export function editDish(params) {
  return request({
    url: '/dish',
    method: 'put',
    data: { ...params }
  })
}

export function addDish(params) {
  return request({
    url: '/dish',
    method: 'post',
    data: { ...params }
  })
}
